home *** CD-ROM | disk | FTP | other *** search
- /*
- * lock_file - functions for file locking
- *
- * You may freely copy, distribute and reuse the code in this example.
- * This code is provided AS IS without warranty of any kind, expressed
- * or implied, as to its fitness for any particular use.
- *
- * Copyright 1995 Ralph Zazula (zazula@next.com). All Rights Reserved.
- *
- */
-
- #define LOCK_SUCCESS 0
- #define LOCK_EXIST -1
- #define LOCK_NOCREATE -2
-
- int lock_file(char *filename);
- /*
- * Drops a lock file "filename.lock" for "filename". Returns:
- * LOCK_SUCCESS (0) success
- * LOCK_EXIST (-1) lock file already exists
- * LOCK_NOCREATE (-2) couldn't create lock file
- */
-
- int unlock_file(char *filename);
- /*
- * removes the lock file "filename.lock" for "filename".
- * Returns LOCK_SUCCESS on success and a negative error code on failure.
- * The error code is that which resulted from the attempted unlink().
- */
-